package com.Txunda.fxw.ui.adapter;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

/**
 * �ֲ�ͼ������
 * @author Administrator
 *
 */
public class MyVpAdapter extends PagerAdapter{

	private ArrayList<View>arr;
	public MyVpAdapter(ArrayList<View>arr) {
		this.arr = arr;
	}
	@Override
	public void destroyItem(View container, int position, Object object) {
		((ViewPager) container).removeView(arr.get(position));
	}

	@Override
	public Object instantiateItem(View container, int position) {
		((ViewPager) container).addView(arr.get(position));
		return arr.get(position);
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0 == arg1;
	}

	@Override
	public int getCount() {
		return arr.size();
	}

}
